fix!: Consistent card/cardBefore on CardUpdatedEvent#7156
Conversation
Signed-off-by: Viktor Diezel <viktor.diezel@posteo.de>
Signed-off-by: Viktor Diezel <viktor.diezel@posteo.de>
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Signed-off-by: Viktor Diezel <37934155+vdiezel@users.noreply.github.com>
|
Is there anything I can do to get this PR merged? Happy to fix any issues. |
|
@vdiezel tbh I think we can merge this after a rebase to get main back in! |
Summary
As mentioned in #7147, the CardUpdatedEvent has two problems:
This makes it difficult for consumers of the event to act upon it.
The CardUpdatedEvent now always has post- and pre-update version of the card. I had to introduce an additional database call in some methods, but they are not ones that are called very frequently, so I think it is fine.
I did check the internal consumers of the CardUpdatedEvent and they should be unaffected. FullTextSearchEventListener relies only on the card ID, which doesn't change, and LiveUpdateListener is only concerned when the boardId of a card changes, which can only happen in the CardService.update which I didn't touch.
I still flagged this as a breaking change because anything outside of the deck app that relies on the inconsistent event might break.
Regarding tests:
I'm not very familiar with phpunit. I was able to add a basic assertion that the CardUpdatedEvent is dispatched and that cardBefore is not
null. However I was not able to assert that the cards are actually the cards before and after the update. This involves some interventions at the setters of the Card class that are beyond my skills. If there is a way, you can nudge me towards it and I will happily add the assertions.Checklist